package org.dwpd.domain.board;

import lombok.Data;
import org.dwpd.utils.DateUtils;

import java.util.Date;

@Data
public class BoardMessage {
    private Integer bmId;
    private String userName;
    private String comment;
    private String userImage;
    private Date createTime;

    // 按格式返回创建时间
    public String getCreateTime() {
        if (createTime == null) {
            return DateUtils.dateFormat(new Date(System.currentTimeMillis()));
        }
        return DateUtils.dateFormat(createTime);
    }
}
